<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>接口文档</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="generator" content="" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="{:base_url()}Public/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="{:base_url()}Public/css/font-awesome-4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--公共自定义样式-->
    <link href="{:base_url()}Public/css/houtai/common.css" rel="stylesheet" type="text/css" />
    <script src="{:base_url()}Public/js/jquery1.9.1.min.js"></script>
    <script src="{:base_url()}Public/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>


</head>
<style>
    .header{
        width: 100%;
        background: url('{:base_url()}Public/images/doc1.png') no-repeat;
        background-size: 100%;
        text-align: center;
        color: #fff;
        font-size: 3rem;
        font-weight: bold;
        padding: 20px;
        min-height: 100px;
    }
    .header a{
        font-size: 20px;
    }
    .header a {
        color: #fff;
    }
    /*添加项目*/
    #addProbox{
        position: absolute;
        top:80px;
        left: 60%;
        width: 300px;
        display: none;
    }
    #addProbox .input-group-addon{
        cursor: pointer;
    }
    .pannelbox{
        position: absolute;
        right: 2rem;
    }
    .pannelbox a{
        font-size: 3rem;
        color: #fff;
        cursor: pointer;
        margin-left: 1rem;
    }
    .pannelbox a:hover{
        color: #669ac7;
    }
    .mline{
        margin-bottom: 10px;
    }

</style>

<body>
<!--等待提示-->
<div id="waiting" style="display: none;width: 100%;background:rgba(100,100,100,0.3);height: 100%;z-index: 2000;position:absolute;top:0px;text-align: center;">
    <i style="font-size:4em;margin-top:25%;" class="fa fa-spinner fa-pulse fa-fw margin-bottom"></i>
</div>
<div id="addProbox">
    <div class="input-group">
        <input type="text" class="form-control proname_ipt">
        <span class="input-group-addon go_addpro">添加</span>
        <span class="input-group-addon cancel_addpro">关闭</span>
    </div>
</div>

<div class="pannelbox">
    <if condition="($admin_user.edit_permission eq 1) or ($admin_user.type eq 0)">
        <a title="用户管理" href="{:U('User/index')}"><i class="fa fa-user"></i></a>
    </if>
    <a title="修改密码" id="changePwd"><i class="fa fa-cog fa-fw"></i></a>
    <a title="退出登录" href="{:U('Login/logout')}"><i class="fa fa-arrow-circle-o-right"></i></a>
</div>
<div class="header">
    {:C("COMPANY_NAME")}接口文档管理
    <eq name="admin_user.edit_permission" value="1">
        <div class="navbox">
            <a class="addPro">添加项目</a>
        </div>
    </eq>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">修改密码</h4>
            </div>
            <div class="modal-body">
                <div class="mline"><label>旧密码：</label><input type="password" id="oldpwd" class="form-control" placeholder="输入旧密码"/></div>
                <div class="mline"><label>新密码：</label><input type="password" id="newpwd" class="form-control" placeholder="输入新密码"/></div>
                <div class="mline"><label>确认新密码：</label><input type="password" id="newpwd1" class="form-control" placeholder="再次输入新密码"/></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="savebtn" data-id="">保存</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<script>
    $(document).ready(function () {
        $('.addPro').click(function () {
            $('#addProbox').show();
        });
        $('.cancel_addpro').click(function () {
            $('#addProbox').hide();
        });
        $('.go_addpro').click(function () {
            $('#waiting').show();
            $.post('{:U("Index/addpro")}',{pro_name:$('.proname_ipt').val()},function (ret) {
                $('#waiting').hide();
                if(ret.status==200){
                    window.location.reload();
                }else{
                    alert(ret.message);
                }
            },'json');
        });
        
        $('#changePwd').click(function () {
            $('#myModal').modal('show');
        });
        $('#savebtn').click(function () {
            $('#waiting').show();
            var data={
                oldpwd:$('#oldpwd').val(),
                newpwd:$('#newpwd').val(),
                newpwd1:$('#newpwd1').val()
            };
            $.post('{:U("User/modifyPwd")}',data,function (res) {
                $('#waiting').hide();
                if(res.status==200){
                    window.location.reload();
                }else{
                    alert(res.message);
                }
            },'json');
        });
    });
</script>





